package com.cxy.services;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cxy.dao.DocumentDao;
import com.cxy.pojo.Document;


@Service
@Transactional
public class DocumentServices {
	@Resource
	private DocumentDao documentDao;
	@Transactional(readOnly=true)
	public List<Document> find(){
		return documentDao.findAll();
	}
	public void del(int id){
		documentDao.del(id);
	}
	@Transactional(readOnly=true)
	public Document get(int id){
		return documentDao.findById(id);
	}
	public void saveOrUpdate(Document document){
		documentDao.saveOrUpdate(document);
	}
}
